package com.agv.core.dao.dataExtractor;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

public class CatalogosResultSetExtractor implements ResultSetExtractor {

	@Override
	public Map<String,String> extractData(ResultSet rs) throws SQLException,
			DataAccessException {
		
		
		Map<String, String> map = new HashMap<String, String>();
		
		while(rs.next()){
			//sabemos q de antemano el query regresa dos columnas, id_campo y nb_campo
			map.put( rs.getString(1), rs.getString(2) );
		}
		
		return map;

	}

}
